'use stricts'

const fs = require ("fs")


const file_data = JSON.parse(fs.readFileSync("stock.json").toString())

let flag = false

for ( let i of (Object.keys (file_data )) ) {

    if (file_data[i].hasStock == true) {
	//console.log(JSON.stringify(file_data[i]))

	flag = true

	console.log(file_data[i]["name"] + "_Q" + file_data[i]["quantity"] + "_H" + file_data[i]["hasStock"] )
    }
}

if (flag == false)
    console.log ( "waiting for vm" )
